Update to newest Rust
authorJakub Bukaj <jakub@jakub.cc>
Sat, 22 Nov 2014 10:04:40 +0000 (05:04 -0500)
committerJakub Bukaj <jakub@jakub.cc>
Sun, 23 Nov 2014 22:02:45 +0000 (17:02 -0500)
48 files changed:
Cargo.lock
src/bin/config_for_key.rs
src/bin/config_list.rs
src/cargo/core/package_id_spec.rs
src/cargo/core/registry.rs
src/cargo/core/resolver/encode.rs
src/cargo/core/resolver/mod.rs
src/cargo/core/summary.rs
src/cargo/ops/cargo_clean.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/cargo_package.rs
src/cargo/ops/cargo_run.rs
src/cargo/ops/cargo_rustc/compilation.rs
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/ops/cargo_test.rs
src/cargo/ops/lockfile.rs
src/cargo/ops/registry.rs
src/cargo/sources/git/source.rs
src/cargo/sources/registry.rs
src/cargo/util/errors.rs
src/cargo/util/important_paths.rs
src/cargo/util/paths.rs
src/cargo/util/process_builder.rs
src/cargo/util/to_url.rs
src/cargo/util/toml.rs
src/cargo/util/vcs.rs
src/registry/lib.rs
src/rustversion.txt
src/snapshots.txt
tests/resolve.rs
tests/support/git.rs
tests/support/mod.rs
tests/support/registry.rs
tests/test_cargo.rs
tests/test_cargo_bench.rs
tests/test_cargo_clean.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_custom_build.rs
tests/test_cargo_compile_git_deps.rs
tests/test_cargo_compile_old_custom_build.rs
tests/test_cargo_compile_path_deps.rs
tests/test_cargo_cross_compile.rs
tests/test_cargo_new.rs
tests/test_cargo_package.rs
tests/test_cargo_registry.rs
tests/test_cargo_test.rs

index 5c599de1fa7205ab71c2063af6cb717739ae3545..319e60b11950b49fbac611fb0a723f9ba512c4aa 100644 (file)
@@ -4,22 +4,22 @@ version = "0.0.1-pre"
 dependencies = [
  "curl 0.1.0 (git+https://github.com/carllerche/curl-rust)",
  "docopt 0.6.8 (git+https://github.com/docopt/docopt.rs)",
- "flate2 0.0.1 (git+https://github.com/alexcrichton/flate2-rs)",
+ "flate2 0.0.3 (git+https://github.com/alexcrichton/flate2-rs)",
  "git2 0.0.1 (git+https://github.com/alexcrichton/git2-rs)",
- "glob 0.0.1 (git+https://github.com/rust-lang/glob)",
+ "glob 0.0.3 (git+https://github.com/rust-lang/glob)",
  "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)",
  "registry 0.0.1-pre",
- "semver 0.1.0 (git+https://github.com/rust-lang/semver)",
- "tar 0.0.1 (git+https://github.com/alexcrichton/tar-rs)",
- "time 0.0.1 (git+https://github.com/rust-lang/time)",
- "toml 0.1.0 (git+https://github.com/alexcrichton/toml-rs)",
+ "semver 0.1.3 (git+https://github.com/rust-lang/semver)",
+ "tar 0.0.3 (git+https://github.com/alexcrichton/tar-rs)",
+ "time 0.0.3 (git+https://github.com/rust-lang/time)",
+ "toml 0.1.2 (git+https://github.com/alexcrichton/toml-rs)",
  "url 0.1.0 (git+https://github.com/servo/rust-url)",
 ]
 
 [[package]]
 name = "curl"
 version = "0.1.0"
-source = "git+https://github.com/carllerche/curl-rust#e6e31d8d601bffdf3c9b31993e6ffe3bc8a99618"
+source = "git+https://github.com/carllerche/curl-rust#c1b96e146f6752353a1e84cca932c628e6bf73af"
 dependencies = [
  "curl-sys 0.1.0 (git+https://github.com/carllerche/curl-rust)",
  "url 0.1.0 (git+https://github.com/servo/rust-url)",
@@ -28,7 +28,7 @@ dependencies = [
 [[package]]
 name = "curl-sys"
 version = "0.1.0"
-source = "git+https://github.com/carllerche/curl-rust#e6e31d8d601bffdf3c9b31993e6ffe3bc8a99618"
+source = "git+https://github.com/carllerche/curl-rust#c1b96e146f6752353a1e84cca932c628e6bf73af"
 dependencies = [
  "libz-sys 0.0.1 (git+https://github.com/alexcrichton/libz-sys)",
  "openssl-sys 0.0.1 (git+https://github.com/sfackler/rust-openssl)",
@@ -38,92 +38,35 @@ dependencies = [
 [[package]]
 name = "docopt"
 version = "0.6.8"
-source = "git+https://github.com/docopt/docopt.rs#911d25c7328c0fdc6499757b9dcb831472e3cc13"
-
-[[package]]
-name = "encoding"
-version = "0.2.1"
-source = "git+https://github.com/lifthrasiir/rust-encoding#6a5a95950572590485cbbf64509036b252339205"
-dependencies = [
- "encoding-index-japanese 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)",
- "encoding-index-korean 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)",
- "encoding-index-simpchinese 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)",
- "encoding-index-singlebyte 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)",
- "encoding-index-tradchinese 1.0.20140915 (git+https://github.com/lifthrasiir/rust-encoding)",
-]
-
-[[package]]
-name = "encoding-index-japanese"
-version = "1.0.20140915"
-source = "git+https://github.com/lifthrasiir/rust-encoding#6a5a95950572590485cbbf64509036b252339205"
-dependencies = [
- "encoding_index_tests 0.1.0 (git+https://github.com/lifthrasiir/rust-encoding)",
-]
-
-[[package]]
-name = "encoding-index-korean"
-version = "1.0.20140915"
-source = "git+https://github.com/lifthrasiir/rust-encoding#6a5a95950572590485cbbf64509036b252339205"
-dependencies = [
- "encoding_index_tests 0.1.0 (git+https://github.com/lifthrasiir/rust-encoding)",
-]
-
-[[package]]
-name = "encoding-index-simpchinese"
-version = "1.0.20140915"
-source = "git+https://github.com/lifthrasiir/rust-encoding#6a5a95950572590485cbbf64509036b252339205"
-dependencies = [
- "encoding_index_tests 0.1.0 (git+https://github.com/lifthrasiir/rust-encoding)",
-]
-
-[[package]]
-name = "encoding-index-singlebyte"
-version = "1.0.20140915"
-source = "git+https://github.com/lifthrasiir/rust-encoding#6a5a95950572590485cbbf64509036b252339205"
-dependencies = [
- "encoding_index_tests 0.1.0 (git+https://github.com/lifthrasiir/rust-encoding)",
-]
-
-[[package]]
-name = "encoding-index-tradchinese"
-version = "1.0.20140915"
-source = "git+https://github.com/lifthrasiir/rust-encoding#6a5a95950572590485cbbf64509036b252339205"
-dependencies = [
- "encoding_index_tests 0.1.0 (git+https://github.com/lifthrasiir/rust-encoding)",
-]
-
-[[package]]
-name = "encoding_index_tests"
-version = "0.1.0"
-source = "git+https://github.com/lifthrasiir/rust-encoding#6a5a95950572590485cbbf64509036b252339205"
+source = "git+https://github.com/docopt/docopt.rs#be2e3b6b91ab1912d79f1e840d9397dead6e6a6e"
 
 [[package]]
 name = "flate2"
-version = "0.0.1"
-source = "git+https://github.com/alexcrichton/flate2-rs#f81e6dc401b2bf32c8274fa1b8327699fb9345c0"
+version = "0.0.3"
+source = "git+https://github.com/alexcrichton/flate2-rs#044e4dc2a766bc32fd5ae76bbe958be6e85be481"
 dependencies = [
- "miniz-sys 0.0.1 (git+https://github.com/alexcrichton/flate2-rs)",
+ "miniz-sys 0.0.2 (git+https://github.com/alexcrichton/flate2-rs)",
 ]
 
 [[package]]
 name = "gcc"
-version = "0.0.1"
-source = "git+https://github.com/alexcrichton/gcc-rs#f25b3ba9c40303781189cc137fb98fffe5b56de7"
+version = "0.0.2"
+source = "git+https://github.com/alexcrichton/gcc-rs#903e8f8a2e3766ad3d514404d452dbaa1d3b2d79"
 
 [[package]]
 name = "git2"
 version = "0.0.1"
-source = "git+https://github.com/alexcrichton/git2-rs#f188fc297b00261372bd3b4f7855cd8082e78cfc"
+source = "git+https://github.com/alexcrichton/git2-rs#d0d21ca14b4a410806b577b04c2d29f7f8e45f61"
 dependencies = [
  "libgit2-sys 0.0.1 (git+https://github.com/alexcrichton/git2-rs)",
- "time 0.0.1 (git+https://github.com/rust-lang/time)",
+ "time 0.0.3 (git+https://github.com/rust-lang/time)",
  "url 0.1.0 (git+https://github.com/servo/rust-url)",
 ]
 
 [[package]]
 name = "glob"
-version = "0.0.1"
-source = "git+https://github.com/rust-lang/glob#5d7ad1dc2f10f8e23b93c025cf5b984d79cf7169"
+version = "0.0.3"
+source = "git+https://github.com/rust-lang/glob#9efe98bd82ad4932819888a94eb933ac618312f0"
 
 [[package]]
 name = "hamcrest"
@@ -133,7 +76,7 @@ source = "git+https://github.com/carllerche/hamcrest-rust.git#2b9bd6cdae5dcf08ac
 [[package]]
 name = "libgit2-sys"
 version = "0.0.1"
-source = "git+https://github.com/alexcrichton/git2-rs#f188fc297b00261372bd3b4f7855cd8082e78cfc"
+source = "git+https://github.com/alexcrichton/git2-rs#d0d21ca14b4a410806b577b04c2d29f7f8e45f61"
 dependencies = [
  "libssh2-sys 0.0.1 (git+https://github.com/alexcrichton/ssh2-rs)",
  "openssl-sys 0.0.1 (git+https://github.com/sfackler/rust-openssl)",
@@ -143,7 +86,7 @@ dependencies = [
 [[package]]
 name = "libssh2-sys"
 version = "0.0.1"
-source = "git+https://github.com/alexcrichton/ssh2-rs#6118d76bb383420be32160af866cbe5fc7141f42"
+source = "git+https://github.com/alexcrichton/ssh2-rs#922531da4c22abe7a216672314315d41769d7fb1"
 dependencies = [
  "libz-sys 0.0.1 (git+https://github.com/alexcrichton/libz-sys)",
  "openssl-sys 0.0.1 (git+https://github.com/sfackler/rust-openssl)",
@@ -160,16 +103,16 @@ dependencies = [
 
 [[package]]
 name = "miniz-sys"
-version = "0.0.1"
-source = "git+https://github.com/alexcrichton/flate2-rs#f81e6dc401b2bf32c8274fa1b8327699fb9345c0"
+version = "0.0.2"
+source = "git+https://github.com/alexcrichton/flate2-rs#044e4dc2a766bc32fd5ae76bbe958be6e85be481"
 dependencies = [
- "gcc 0.0.1 (git+https://github.com/alexcrichton/gcc-rs)",
+ "gcc 0.0.2 (git+https://github.com/alexcrichton/gcc-rs)",
 ]
 
 [[package]]
 name = "openssl-sys"
 version = "0.0.1"
-source = "git+https://github.com/sfackler/rust-openssl#af5533d936558a77c2de8c5d2d572bb1f89dfada"
+source = "git+https://github.com/sfackler/rust-openssl#b084ddc7b0fe9c7816fef6e415a05db6ec43fb71"
 dependencies = [
  "pkg-config 0.0.1 (git+https://github.com/alexcrichton/pkg-config-rs)",
 ]
@@ -188,32 +131,29 @@ dependencies = [
 
 [[package]]
 name = "semver"
-version = "0.1.0"
-source = "git+https://github.com/rust-lang/semver#1672853e20ef4bde672b08d55de40941d907649a"
+version = "0.1.3"
+source = "git+https://github.com/rust-lang/semver#29212953f839337c672d185dde74e14b5dfb1f46"
 
 [[package]]
 name = "tar"
-version = "0.0.1"
-source = "git+https://github.com/alexcrichton/tar-rs#868632ea0dd36200377af2c445d71d387cba1702"
+version = "0.0.3"
+source = "git+https://github.com/alexcrichton/tar-rs#55fa87d43eaf2a54c55ddd245e1c13859a06193c"
 
 [[package]]
 name = "time"
-version = "0.0.1"
-source = "git+https://github.com/rust-lang/time#3194d911a136a7bfa3218cdd5bd3379537de4133"
+version = "0.0.3"
+source = "git+https://github.com/rust-lang/time#533d3823dbe200aaa2a2599176a6b30579581232"
 dependencies = [
- "gcc 0.0.1 (git+https://github.com/alexcrichton/gcc-rs)",
+ "gcc 0.0.2 (git+https://github.com/alexcrichton/gcc-rs)",
 ]
 
 [[package]]
 name = "toml"
-version = "0.1.0"
-source = "git+https://github.com/alexcrichton/toml-rs#4bb575fdaf5fd88580abbac6fdb057ef76d32251"
+version = "0.1.2"
+source = "git+https://github.com/alexcrichton/toml-rs#1e35b001094b20d2452adff305e418591d4000fb"
 
 [[package]]
 name = "url"
 version = "0.1.0"
-source = "git+https://github.com/servo/rust-url#c3d32dae4c5641d034a848d42f88db48dd9feb96"
-dependencies = [
- "encoding 0.2.1 (git+https://github.com/lifthrasiir/rust-encoding)",
-]
+source = "git+https://github.com/servo/rust-url#a838a41263472de966f7ec8db758caa9cc4699a4"
 
index 582318e0a2fb3876f0598316d97e6fea557d004a..f1092c83e232aa2d4f2f55eeb253c5dd90dbce98 100644 (file)
@@ -26,8 +26,9 @@ Options:
 
 pub fn execute(args: ConfigForKeyFlags,
                _: &mut MultiShell) -> CliResult<Option<ConfigOut>> {
-    let value = try!(config::get_config(os::getcwd(),
-                                        args.flag_key.as_slice()).map_err(|_| {
+    let cwd = try!(os::getcwd().map_err(|_|
+        CliError::new("Couldn't determine the current working directory", 1)));
+    let value = try!(config::get_config(cwd, args.flag_key.as_slice()).map_err(|_| {
         CliError::new("Couldn't load configuration",  1)
     }));
 
index 69aba203a51bbcc67dd995007c25b1815024280d..336bad08f0120182d36215a06aff8e1d5822c330 100644 (file)
@@ -25,7 +25,9 @@ Options:
 
 pub fn execute(args: ConfigListFlags,
                _: &mut MultiShell) -> CliResult<Option<ConfigOut>> {
-    let configs = try!(config::all_configs(os::getcwd()).map_err(|_|
+    let cwd = try!(os::getcwd().map_err(|_|
+        CliError::new("Couldn't determine the current working directory", 1)));
+    let configs = try!(config::all_configs(cwd).map_err(|_|
         CliError::new("Couldn't load configuration", 1)));
 
     if args.flag_human {
index 7ce03616d9007a1ad1f2b8949c0ceedc451295d0..19fb635a800af73fba49032d9fbefa83d94e2ec7 100644 (file)
@@ -121,7 +121,7 @@ fn url(s: &str) -> url::ParseResult<Url> {
 
     fn mapper(scheme: &str) -> url::SchemeType {
         if scheme == "cargo" {
-            url::RelativeScheme(1)
+            url::SchemeType::Relative(1)
         } else {
             url::whatwg_scheme_type_mapper(scheme)
         }
index 3f56203002e9bb8139333fd0ddb49d12e9f5ad2d..39dba008ffc071050de8a69cd9291d60d06e3d0d 100644 (file)
@@ -214,7 +214,7 @@ impl<'a> PackageRegistry<'a> {
     // map a dependency though, we just pass it on through.
     fn lock(&self, summary: Summary) -> Summary {
         let pair = self.locked.get(summary.get_source_id()).and_then(|map| {
-            map.find_equiv(summary.get_name())
+            map.get(summary.get_name())
         }).and_then(|vec| {
             vec.iter().find(|&&(ref id, _)| id == summary.get_package_id())
         });
@@ -243,7 +243,7 @@ impl<'a> PackageRegistry<'a> {
                 // on.
                 None => {
                     let v = self.locked.get(dep.get_source_id()).and_then(|map| {
-                        map.find_equiv(dep.get_name())
+                        map.get(dep.get_name())
                     }).and_then(|vec| {
                         vec.iter().find(|&&(ref id, _)| dep.matches_id(id))
                     });
index 203f3c7dd94b3a5fc4a3e4a4ab716bfb8b52b4ab..3710f8003716d363e178179eef6b68071f903e26 100644 (file)
@@ -32,7 +32,7 @@ impl EncodableResolve {
                                    .map(|s| s.to_string());
                 assert!(tmp.insert(pkgid.clone(), precise).is_none(),
                         "a package was referenced twice in the lockfile");
-                g.add(try!(pkg.to_package_id(default)), []);
+                g.add(try!(pkg.to_package_id(default)), &[]);
                 Ok(())
             };
 
index 67bac89882d5fb86186803bc3cbd16b6610a8f10..956a3f3b877815f9eb57901abfbbb36294840a33 100644 (file)
@@ -40,7 +40,7 @@ pub enum Method<'a> {
 impl Resolve {
     fn new(root: PackageId) -> Resolve {
         let mut g = Graph::new();
-        g.add(root.clone(), []);
+        g.add(root.clone(), &[]);
         Resolve { graph: g, root: root, features: HashMap::new(), metadata: None }
     }
 
@@ -251,7 +251,7 @@ fn activate_deps<'a, R: Registry>(cx: Context,
                     None => features.len() == 0,
                 }
             } else {
-                my_cx.resolve.graph.add(candidate.get_package_id().clone(), []);
+                my_cx.resolve.graph.add(candidate.get_package_id().clone(), &[]);
                 prev.push(candidate.clone());
                 false
             }
@@ -374,11 +374,10 @@ fn resolve_features<'a>(cx: &mut Context, parent: &'a Summary,
     // features that correspond to optional dependencies
     for dep in deps {
         // weed out optional dependencies, but not those required
-        if dep.is_optional() && !feature_deps.contains_key_equiv(dep.get_name()) {
+        if dep.is_optional() && !feature_deps.contains_key(dep.get_name()) {
             continue
         }
-        let mut base = feature_deps.pop_equiv(dep.get_name())
-                                   .unwrap_or(Vec::new());
+        let mut base = feature_deps.remove(dep.get_name()).unwrap_or(vec![]);
         for feature in dep.get_features().iter() {
             base.push(feature.clone());
             if feature.as_slice().contains("/") {
@@ -451,8 +450,8 @@ fn build_features(s: &Summary, method: Method)
     }
     match method {
         Method::Everything | Method::Required(_, _, true, _) => {
-            if s.get_features().find_equiv("default").is_some() &&
-               !visited.contains_equiv("default") {
+            if s.get_features().get("default").is_some() &&
+               !visited.contains("default") {
                 try!(add_feature(s, "default", &mut deps, &mut used,
                                  &mut visited));
             }
@@ -490,7 +489,7 @@ fn build_features(s: &Summary, method: Method)
                                               feat)))
                 }
                 used.insert(feat.to_string());
-                match s.get_features().find_equiv(feat) {
+                match s.get_features().get(feat) {
                     Some(recursive) => {
                         for f in recursive.iter() {
                             try!(add_feature(s, f.as_slice(), deps, used,
index 2212569485ce7f72a010d0f2ac047a58b6b16cb6..a30c65438ff51cb37bdda9226556677134ccb7fb 100644 (file)
@@ -22,7 +22,7 @@ impl Summary {
                dependencies: Vec<Dependency>,
                features: HashMap<String, Vec<String>>) -> CargoResult<Summary> {
         for dep in dependencies.iter() {
-            if features.find_equiv(dep.get_name()).is_some() {
+            if features.get(dep.get_name()).is_some() {
                 return Err(human(format!("Features and dependencies cannot have \
                                           the same name: `{}`", dep.get_name())))
             }
@@ -37,7 +37,7 @@ impl Summary {
                 let mut parts = dep.as_slice().splitn(1, '/');
                 let dep = parts.next().unwrap();
                 let is_reexport = parts.next().is_some();
-                if !is_reexport && features.find_equiv(dep).is_some() { continue }
+                if !is_reexport && features.get(dep).is_some() { continue }
                 match dependencies.iter().find(|d| d.get_name() == dep) {
                     Some(d) => {
                         if d.is_optional() || is_reexport { continue }
index 4474302ba22e7d27b707cd9ef6cd4488a0cc2674..c9b117b97d29d163a7e3645d960cf99b0d231020 100644 (file)
@@ -41,13 +41,13 @@ pub fn clean(manifest_path: &Path, opts: &mut CleanOptions) -> CargoResult<()> {
     let pkg = {
         let mut source = pkgid.get_source_id().load(&mut cfg);
         try!(source.update());
-        (try!(source.get([pkgid.clone()]))).into_iter().next().unwrap()
+        (try!(source.get(&[pkgid.clone()]))).into_iter().next().unwrap()
     };
 
     // Create a compilation context to have access to information like target
     // filenames and such
     let srcs = SourceMap::new();
-    let pkgs = PackageSet::new([]);
+    let pkgs = PackageSet::new(&[]);
     let cx = try!(Context::new("compile", &resolve, &srcs, &pkgs, &mut cfg,
                                Layout::at(root.get_absolute_target_dir()),
                                None, &pkg, Default::default()));
index a7b9ae8af08b8f4885aec5e7ad9cd9680145db56..9a4ddfeb678e965991dbecaf266c7e2a9a815f4b 100644 (file)
@@ -83,7 +83,7 @@ pub fn compile_pkg(package: &Package, options: &mut CompileOptions)
                           is not being built"))
     }
 
-    let user_configs = try!(config::all_configs(os::getcwd()));
+    let user_configs = try!(config::all_configs(try!(os::getcwd())));
     let override_ids = try!(source_ids_from_config(&user_configs,
                                                    package.get_root()));
     let config = try!(Config::new(*shell, jobs, target.clone()));
@@ -159,7 +159,7 @@ fn source_ids_from_config(configs: &HashMap<String, config::ConfigValue>,
                           cur_path: Path) -> CargoResult<Vec<SourceId>> {
     debug!("loaded config; configs={}", configs);
 
-    let config_paths = match configs.find_equiv("paths") {
+    let config_paths = match configs.get("paths") {
         Some(cfg) => cfg,
         None => return Ok(Vec::new())
     };
@@ -182,7 +182,7 @@ fn source_ids_from_config(configs: &HashMap<String, config::ConfigValue>,
 fn scrape_build_config(config: &Config,
                        configs: &HashMap<String, config::ConfigValue>)
                        -> CargoResult<ops::BuildConfig> {
-    let target = match configs.find_equiv("target") {
+    let target = match configs.get("target") {
         None => return Ok(Default::default()),
         Some(target) => try!(target.table().chain_error(|| {
             internal("invalid configuration for the key `target`")
index 84ea5bda2dd4e3336b791358b72eb7f9765e2f29..3c7ac8a10b4d067dd972de2a3b61f41b515f4094 100644 (file)
@@ -23,7 +23,7 @@ struct CargoNewConfig {
 }
 
 pub fn new(opts: NewOptions, _shell: &mut MultiShell) -> CargoResult<()> {
-    let path = os::getcwd().join(opts.path);
+    let path = try!(os::getcwd()).join(opts.path);
     if path.exists() {
         return Err(human(format!("Destination `{}` already exists",
                                  path.display())))
@@ -130,19 +130,19 @@ fn discover_author() -> CargoResult<(String, Option<String>)> {
 }
 
 fn global_config() -> CargoResult<CargoNewConfig> {
-    let user_configs = try!(config::all_configs(os::getcwd()));
+    let user_configs = try!(config::all_configs(try!(os::getcwd())));
     let mut cfg = CargoNewConfig {
         name: None,
         email: None,
         git: None,
     };
-    let cargo_new = match user_configs.find_equiv("cargo-new") {
+    let cargo_new = match user_configs.get("cargo-new") {
         None => return Ok(cfg),
         Some(target) => try!(target.table().chain_error(|| {
             internal("invalid configuration for the key `cargo-new`")
         })),
     };
-    cfg.name = match cargo_new.find_equiv("name") {
+    cfg.name = match cargo_new.get("name") {
         None => None,
         Some(name) => {
             Some(try!(name.string().chain_error(|| {
@@ -150,7 +150,7 @@ fn global_config() -> CargoResult<CargoNewConfig> {
             })).ref0().to_string())
         }
     };
-    cfg.email = match cargo_new.find_equiv("email") {
+    cfg.email = match cargo_new.get("email") {
         None => None,
         Some(email) => {
             Some(try!(email.string().chain_error(|| {
@@ -158,7 +158,7 @@ fn global_config() -> CargoResult<CargoNewConfig> {
             })).ref0().to_string())
         }
     };
-    cfg.git = match cargo_new.find_equiv("git") {
+    cfg.git = match cargo_new.get("git") {
         None => None,
         Some(git) => {
             Some(try!(git.boolean().chain_error(|| {
index 25bdfd7143cf709cc9244ac1f192fb37aaee5f42..2bb3816f35f98f162bff66bd2d3c81c531d7eaac 100644 (file)
@@ -175,7 +175,7 @@ fn run_verify(pkg: &Package, shell: &mut MultiShell, tar: &Path)
         jobs: None,
         target: None,
         dev_deps: false,
-        features: [],
+        features: &[],
         no_default_features: false,
         spec: None,
         lib_only: false,
index 914fc90a078da719af8f0c7b5ccea07eac3c4ea7..82eaf9ab9551c86f58434f10167930987339351e 100644 (file)
@@ -45,12 +45,13 @@ pub fn run(manifest_path: &Path,
         Some(s) => dst.join(s).join(bin.get_name()),
         None => dst.join(bin.get_name()),
     };
-    let exe = match exe.path_relative_from(&os::getcwd()) {
+    let exe = match exe.path_relative_from(&try!(os::getcwd())) {
         Some(path) => path,
         None => exe,
     };
     let process = try!(compile.process(exe, &root))
-                              .args(args).cwd(os::getcwd());
+                              .args(args)
+                              .cwd(try!(os::getcwd()));
 
     try!(options.shell.status("Running", process.to_string()));
     Ok(process.exec().err())
index 381cf968847a19cf28983facecbe458d5bb34ab1..073298670ee538b825cbe9ea7062b7463786252f 100644 (file)
@@ -69,8 +69,8 @@ impl Compilation {
         search_path.push(self.deps_output.clone());
         let search_path = try!(util::join_paths(search_path.as_slice(),
                                                 DynamicLibrary::envvar()));
-        let mut cmd = util::process(cmd).env(DynamicLibrary::envvar(),
-                                             Some(search_path.as_slice()));
+        let mut cmd = try!(util::process(cmd)).env(
+            DynamicLibrary::envvar(), Some(search_path.as_slice()));
         for (k, v) in self.extra_env.iter() {
             cmd = cmd.env(k.as_slice(), v.as_ref().map(|s| s.as_slice()));
         }
index 7ed26ebb30914a0c8b433daff903f2bab8e38343..50cb3fb7027c07295f5e4f661c6dced12196b2b8 100644 (file)
@@ -79,7 +79,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> {
     /// specified as well as the exe suffix
     fn filename_parts(target: Option<&str>)
                       -> CargoResult<(Option<(String, String)>, String)> {
-        let process = util::process("rustc")
+        let process = try!(util::process("rustc"))
                            .arg("-")
                            .arg("--crate-name").arg("-")
                            .arg("--crate-type").arg("dylib")
index 28ad3c6592063f35d8a449ac906af021f020a513..5c4a00befda6e42cc72fba8e64b82c5e73f581b3 100644 (file)
@@ -46,8 +46,10 @@ pub struct TargetConfig {
 /// The second element of the tuple returned is the target triple that rustc
 /// is a host for.
 pub fn rustc_version() -> CargoResult<(String, String)> {
-    let output = try!(util::process("rustc").arg("-v").arg("verbose")
-                           .exec_with_output());
+    let output = try!(try!(util::process("rustc"))
+        .arg("-v")
+        .arg("verbose")
+        .exec_with_output());
     let output = try!(String::from_utf8(output.output).map_err(|_| {
         internal("rustc -v didn't return utf8 output")
     }));
@@ -585,7 +587,7 @@ fn build_base_args(cx: &Context,
         cmd = cmd.arg("--opt-level").arg(profile.get_opt_level().to_string());
     }
     if (target.is_bin() || target.is_staticlib()) && profile.get_lto() {
-        cmd = cmd.args(["-C", "lto"]);
+        cmd = cmd.args(&["-C", "lto"]);
     } else {
         // There are some restrictions with LTO and codegen-units, so we
         // only add codegen units when LTO is not used.
@@ -598,7 +600,7 @@ fn build_base_args(cx: &Context,
     if profile.get_debug() {
         cmd = cmd.arg("-g");
     } else {
-        cmd = cmd.args(["--cfg", "ndebug"]);
+        cmd = cmd.args(&["--cfg", "ndebug"]);
     }
 
     if profile.is_test() && profile.uses_test_harness() {
index 3e8de8282bb8b159b513d91525e6e78947f1e660..5181b3642783b1fc0cf4866032aaf60c870c7c60 100644 (file)
@@ -26,7 +26,7 @@ pub fn run_tests(manifest_path: &Path,
         target_name.map_or(true, |target_name| target_name == test_name.as_slice())
     });
 
-    let cwd = os::getcwd();
+    let cwd = try!(os::getcwd());
     for &(_, ref exe) in tests_to_run {
         let to_display = match exe.path_relative_from(&cwd) {
             Some(path) => path,
index 25ff599cf2de2893143eab8acb932f9fc007df30..631ad09ad6babc61c19d7f5b2982c215d7372e2b 100644 (file)
@@ -1,7 +1,7 @@
 use std::io::File;
 
 use serialize::{Encodable, Decodable};
-use toml::{mod, Encoder};
+use toml::{mod, Encoder, Value};
 
 use core::{Resolve, resolver, Package, SourceId};
 use util::CargoResult;
@@ -76,12 +76,12 @@ fn emit_package(dep: &toml::TomlTable, out: &mut String) {
     }
 
     if let Some(ref s) = dep.get(&"dependencies".to_string()) {
-        let slice = s.as_slice().unwrap();
+        let slice = Value::as_slice(*s).unwrap();
 
         if !slice.is_empty() {
             out.push_str("dependencies = [\n");
 
-            for child in s.as_slice().unwrap().iter() {
+            for child in slice.iter() {
                 out.push_str(format!(" {},\n", child).as_slice());
             }
 
index 7283bb50c354bf396b9ba0fdca075875d3a3b166..1486771ea83a02ad8cb109d79930cc3b4053b9d9 100644 (file)
@@ -109,14 +109,14 @@ fn transmit(pkg: &Package, tarball: &Path, registry: &mut Registry)
 }
 
 pub fn registry_configuration() -> CargoResult<RegistryConfig> {
-    let configs = try!(config::all_configs(os::getcwd()));
-    let registry = match configs.find_equiv("registry") {
+    let configs = try!(config::all_configs(try!(os::getcwd())));
+    let registry = match configs.get("registry") {
         None => return Ok(RegistryConfig { index: None, token: None }),
         Some(registry) => try!(registry.table().chain_error(|| {
             internal("invalid configuration for the key `registry`")
         })),
     };
-    let index = match registry.find_equiv("index") {
+    let index = match registry.get("index") {
         None => None,
         Some(index) => {
             Some(try!(index.string().chain_error(|| {
@@ -124,7 +124,7 @@ pub fn registry_configuration() -> CargoResult<RegistryConfig> {
             })).ref0().to_string())
         }
     };
-    let token = match registry.find_equiv("token") {
+    let token = match registry.get("token") {
         None => None,
         Some(token) => {
             Some(try!(token.string().chain_error(|| {
@@ -174,13 +174,13 @@ pub fn http_handle() -> CargoResult<http::Handle> {
 /// Favor cargo's `http.proxy`, then git's `http.proxy`, then finally a
 /// HTTP_PROXY env var.
 pub fn http_proxy() -> CargoResult<Option<String>> {
-    let configs = try!(config::all_configs(os::getcwd()));
-    match configs.find_equiv("http") {
+    let configs = try!(config::all_configs(try!(os::getcwd())));
+    match configs.get("http") {
         Some(http) => {
             let http = try!(http.table().chain_error(|| {
                 internal("invalid configuration for the key `http`")
             }));
-            match http.find_equiv("proxy") {
+            match http.get("proxy") {
                 Some(proxy) => {
                     return Ok(Some(try!(proxy.string().chain_error(|| {
                         internal("invalid configuration for key `http.proxy`")
@@ -207,7 +207,7 @@ pub fn registry_login(shell: &mut MultiShell, token: String) -> CargoResult<()>
     let config = try!(Config::new(shell, None, None));
     let RegistryConfig { index, token: _ } = try!(registry_configuration());
     let mut map = HashMap::new();
-    let p = os::getcwd();
+    let p = try!(os::getcwd());
     match index {
         Some(index) => {
             map.insert("index".to_string(), ConfigValue::String(index, p.clone()));
index 996cb7844a1a4ebdc555d7e9506afc14cd0dd28e..cce8cb2122ad0d2d5576c14e8d8987f952cc55b4 100644 (file)
@@ -89,7 +89,7 @@ pub fn canonicalize_url(url: &Url) -> Url {
 
     // Strip a trailing slash
     match url.scheme_data {
-        url::RelativeSchemeData(ref mut rel) => {
+        url::SchemeData::Relative(ref mut rel) => {
             if rel.path.last().map(|s| s.is_empty()).unwrap_or(false) {
                 rel.path.pop();
             }
@@ -105,7 +105,7 @@ pub fn canonicalize_url(url: &Url) -> Url {
     if url.domain() == Some("github.com") {
         url.scheme = "https".to_string();
         match url.scheme_data {
-            url::RelativeSchemeData(ref mut rel) => {
+            url::SchemeData::Relative(ref mut rel) => {
                 rel.port = Some(443);
                 rel.default_port = Some(443);
                 let path = mem::replace(&mut rel.path, Vec::new());
@@ -119,7 +119,7 @@ pub fn canonicalize_url(url: &Url) -> Url {
 
     // Repos generally can be accessed with or w/o '.git'
     match url.scheme_data {
-        url::RelativeSchemeData(ref mut rel) => {
+        url::SchemeData::Relative(ref mut rel) => {
             let needs_chopping = {
                 let last = rel.path.last().map(|s| s.as_slice()).unwrap_or("");
                 last.ends_with(".git")
index 364d2bbbc3dca5a8d5315a9c921165b0cf8e2f4c..bea14aa85165823afbbc60375964b581fc9a92da 100644 (file)
@@ -357,8 +357,8 @@ impl<'a, 'b> RegistrySource<'a, 'b> {
 
     /// Parse the on-disk metadata for the package provided
     fn summaries(&mut self, name: &str) -> CargoResult<&Vec<(Summary, bool)>> {
-        if self.cache.contains_key_equiv(name) {
-            return Ok(self.cache.find_equiv(name).unwrap());
+        if self.cache.contains_key(name) {
+            return Ok(self.cache.get(name).unwrap());
         }
         // see module comment for why this is structured the way it is
         let path = self.checkout_path.clone();
@@ -385,7 +385,7 @@ impl<'a, 'b> RegistrySource<'a, 'b> {
             Err(..) => Vec::new(),
         };
         self.cache.insert(name.to_string(), summaries);
-        Ok(self.cache.find_equiv(name).unwrap())
+        Ok(self.cache.get(name).unwrap())
     }
 
     /// Parse a line from the registry's index file into a Summary for a
index 0c6132514b69e317f9702d4e4ef870461cce1cf4..c91a37ed1418373124c58d69e777109b3180e88d 100644 (file)
@@ -1,6 +1,6 @@
 use std::io::process::{ProcessOutput, ProcessExit, ExitStatus, ExitSignal};
 use std::io::IoError;
-use std::fmt::{mod, Show, Formatter, FormatError};
+use std::fmt::{mod, Show, Formatter};
 use std::str;
 use serialize::json;
 use semver;
@@ -107,13 +107,13 @@ impl CargoError for TomlError {
 
 from_error!(TomlError)
 
-impl CargoError for FormatError {
+impl CargoError for fmt::Error {
     fn description(&self) -> String {
         "formatting failed".to_string()
     }
 }
 
-from_error!(FormatError)
+from_error!(fmt::Error)
 
 impl CargoError for curl::ErrCode {
     fn description(&self) -> String { self.to_string() }
index bcbe22abfbdb408c43d5ded09837d55247e05077..7abffd6550e0812adbb14451cbb6bf4993673461 100644 (file)
@@ -33,14 +33,15 @@ pub fn find_project_manifest(pwd: &Path, file: &str) -> CargoResult<Path> {
 
 /// Find the root Cargo.toml
 pub fn find_root_manifest_for_cwd(manifest_path: Option<String>) -> CliResult<Path> {
-    match manifest_path {
-        Some(path) => Ok(Path::new(path)),
-        None => match find_project_manifest(&os::getcwd(), "Cargo.toml") {
-            Ok(x) => Ok(x),
-            Err(_) => Err(CliError::new("Could not find Cargo.toml in this \
-                                         directory or any parent directory", 102))
-        }
-    }.map(|path| os::make_absolute(&path))
+    manifest_path.map(|path| Ok(Path::new(path))).unwrap_or_else(|| os::getcwd()
+        .map_err(|_| CliError::new("Couldn't determine the current working directory", 103))
+        .and_then(|cwd| find_project_manifest(&cwd, "Cargo.toml")
+            .map_err(|_| CliError::new("Could not find Cargo.toml in this \
+                    directory or any parent directory", 102))
+        )
+    )
+        .and_then(|path| os::make_absolute(&path).map_err(|_|
+            CliError::new("Could not determine the absolute path of the manifest", 104)))
 }
 
 /// Return the path to the `file` in `pwd`, if it exists.
index 28441e4fda58a495eb68a66c4c829f63166411bc..6b84f1944020729e63d954eaf6b89868f8865e3e 100644 (file)
@@ -6,7 +6,7 @@ use util::{human, CargoResult};
 
 pub fn realpath(original: &Path) -> io::IoResult<Path> {
     static MAX_LINKS_FOLLOWED: uint = 256;
-    let original = os::make_absolute(original);
+    let original = try!(os::make_absolute(original));
 
     // Right now lstat on windows doesn't work quite well
     if cfg!(windows) {
index 3a503200cc419fc9ff5990aa4201be70688d0348..c190ec522bad57cbbbf8447d8136a47cecc5c3a7 100644 (file)
@@ -4,7 +4,7 @@ use std::c_str::CString;
 use std::io::process::{Command, ProcessOutput, InheritFd};
 use std::collections::HashMap;
 
-use util::{ProcessError, process_error};
+use util::{CargoResult, ProcessError, process_error};
 
 #[deriving(Clone,PartialEq)]
 pub struct ProcessBuilder {
@@ -119,11 +119,11 @@ impl ProcessBuilder {
     }
 }
 
-pub fn process<T: ToCStr>(cmd: T) -> ProcessBuilder {
-    ProcessBuilder {
+pub fn process<T: ToCStr>(cmd: T) -> CargoResult<ProcessBuilder> {
+    Ok(ProcessBuilder {
         program: cmd.to_c_str(),
         args: Vec::new(),
-        cwd: os::getcwd(),
+        cwd: try!(os::getcwd()),
         env: HashMap::new(),
-    }
+    })
 }
index f4fe444426a87139d9f4f216d577931357f30ecf..f11b9641489f331d4b3db44484822073f7159c7a 100644 (file)
@@ -34,8 +34,8 @@ impl<'a> ToUrl for &'a Path {
 
 fn mapper(s: &str) -> url::SchemeType {
     match s {
-        "git" => url::RelativeScheme(9418),
-        "ssh" => url::RelativeScheme(22),
+        "git" => url::SchemeType::Relative(9418),
+        "ssh" => url::SchemeType::Relative(22),
         s => url::whatwg_scheme_type_mapper(s),
     }
 }
index df35ae279bd1772440ac3ccb0b717d844734f908..e5a7fb1b4a01e1e349bd90030ad0815dde6314cb 100644 (file)
@@ -93,7 +93,7 @@ pub fn to_manifest(contents: &[u8],
                    layout: Layout)
                    -> CargoResult<(Manifest, Vec<Path>)> {
     let manifest = layout.root.join("Cargo.toml");
-    let manifest = match manifest.path_relative_from(&os::getcwd()) {
+    let manifest = match manifest.path_relative_from(&try!(os::getcwd())) {
         Some(path) => path,
         None => manifest,
     };
index b4f7ce290c2509f2cff9a1624088e6d54cfd6a4e..3528875aa57e46571998667a75f67e4232003359 100644 (file)
@@ -18,7 +18,7 @@ impl GitRepo {
 impl HgRepo {
     pub fn init(path: &Path) -> CargoResult<HgRepo> {
         let path_str = path.as_str().unwrap();
-        try!(process("hg").arg("init").arg(path_str).exec());
+        try!(try!(process("hg")).arg("init").arg(path_str).exec());
         return Ok(HgRepo)
     }
 }
index 38a1109239b8f25ae2854e662aea1b662e71126f..8768c592a439ca5c9dab7326eecc696ac47fcaf3 100644 (file)
@@ -145,7 +145,7 @@ impl Registry {
 
     pub fn unyank(&mut self, krate: &str, version: &str) -> Result<()> {
         let body = try!(self.put(format!("/crates/{}/{}/unyank", krate, version),
-                                 []));
+                                 &[]));
         assert!(json::decode::<R>(body.as_slice()).unwrap().ok);
         Ok(())
     }
index 200c38292331610e457e5b32255fbe3d37938140..9520ecf601db913824687a659a440eebe2d6d9dd 100644 (file)
@@ -1 +1 @@
-2014-11-18
+2014-11-22
index 304f5c30673cbd8f010852906a404d79605fd4cf..c1b952d520404925cc9d6ea59914b6124e52175a 100644 (file)
@@ -1,3 +1,11 @@
+2014-11-22
+  linux-i386 3204c8a38721199f69d2971db887d1dc71a63825
+  linux-x86_64 39ca0d02eac184bc764ff9c1f645ca361715c5c2
+  macos-i386 ebc1836424c4b3ba49f9adef271c50d2a8e134c0
+  macos-x86_64 a2045e95984b65eab4a704152566f8ab9a3be518
+  winnt-i386 5e0831b14d2e6ee91ef195dfbc4d9699499d5e99
+  winnt-x86_64 d5fa1b58207346061898459955fa7f0b33d77474
+
 2014-11-11
   linux-i386 5cbf3346309d303cb954c363097fc4abedf50610
   linux-x86_64 8c1594e227eca6f23ba02daa5f3cd6150ac88907
index dc5e4dc9c57c3fe73ae7de7097f9fe7f240f0898..4e787564ae876066ffa4d1a4e128f2baa01327b7 100644 (file)
@@ -125,7 +125,7 @@ fn test_resolving_empty_dependency_list() {
     let res = resolve(pkg_id("root"), Vec::new(),
                       &mut registry(vec!())).unwrap();
 
-    assert_that(&res, equal_to(&names(["root"])));
+    assert_that(&res, equal_to(&names(&["root"])));
 }
 
 #[test]
@@ -133,7 +133,7 @@ fn test_resolving_only_package() {
     let mut reg = registry(vec!(pkg("foo")));
     let res = resolve(pkg_id("root"), vec![dep("foo")], &mut reg);
 
-    assert_that(&res.unwrap(), contains(names(["root", "foo"])).exactly());
+    assert_that(&res.unwrap(), contains(names(&["root", "foo"])).exactly());
 }
 
 #[test]
@@ -141,7 +141,7 @@ fn test_resolving_one_dep() {
     let mut reg = registry(vec!(pkg("foo"), pkg("bar")));
     let res = resolve(pkg_id("root"), vec![dep("foo")], &mut reg);
 
-    assert_that(&res.unwrap(), contains(names(["root", "foo"])).exactly());
+    assert_that(&res.unwrap(), contains(names(&["root", "foo"])).exactly());
 }
 
 #[test]
@@ -150,7 +150,7 @@ fn test_resolving_multiple_deps() {
     let res = resolve(pkg_id("root"), vec![dep("foo"), dep("baz")],
                       &mut reg).unwrap();
 
-    assert_that(&res, contains(names(["root", "foo", "baz"])).exactly());
+    assert_that(&res, contains(names(&["root", "foo", "baz"])).exactly());
 }
 
 #[test]
@@ -158,7 +158,7 @@ fn test_resolving_transitive_deps() {
     let mut reg = registry(vec!(pkg!("foo"), pkg!("bar" => ["foo"])));
     let res = resolve(pkg_id("root"), vec![dep("bar")], &mut reg).unwrap();
 
-    assert_that(&res, contains(names(["root", "foo", "bar"])));
+    assert_that(&res, contains(names(&["root", "foo", "bar"])));
 }
 
 #[test]
@@ -167,7 +167,7 @@ fn test_resolving_common_transitive_deps() {
     let res = resolve(pkg_id("root"), vec![dep("foo"), dep("bar")],
                       &mut reg).unwrap();
 
-    assert_that(&res, contains(names(["root", "foo", "bar"])));
+    assert_that(&res, contains(names(&["root", "foo", "bar"])));
 }
 
 #[test]
@@ -181,8 +181,8 @@ fn test_resolving_with_same_name() {
                            dep_loc("bar", "http://second.example.com")],
                       &mut reg);
 
-    let mut names = loc_names([("foo", "http://first.example.com"),
-                               ("bar", "http://second.example.com")]);
+    let mut names = loc_names(&[("foo", "http://first.example.com"),
+                                ("bar", "http://second.example.com")]);
 
     names.push(pkg_id("root"));
 
@@ -202,7 +202,7 @@ fn test_resolving_with_dev_deps() {
                       vec![dep("foo"), dep("baz").kind(Development)],
                       &mut reg).unwrap();
 
-    assert_that(&res, contains(names(["root", "foo", "bar", "baz"])));
+    assert_that(&res, contains(names(&["root", "foo", "bar", "baz"])));
 }
 
 #[test]
@@ -214,8 +214,8 @@ fn resolving_with_many_versions() {
 
     let res = resolve(pkg_id("root"), vec![dep("foo")], &mut reg).unwrap();
 
-    assert_that(&res, contains(names([("root", "1.0.0"),
-                                      ("foo", "1.0.2")])));
+    assert_that(&res, contains(names(&[("root", "1.0.0"),
+                                       ("foo", "1.0.2")])));
 }
 
 #[test]
@@ -228,8 +228,8 @@ fn resolving_with_specific_version() {
     let res = resolve(pkg_id("root"), vec![dep_req("foo", "=1.0.1")],
                       &mut reg).unwrap();
 
-    assert_that(&res, contains(names([("root", "1.0.0"),
-                                      ("foo", "1.0.1")])));
+    assert_that(&res, contains(names(&[("root", "1.0.0"),
+                                       ("foo", "1.0.1")])));
 }
 
 #[test]
@@ -259,9 +259,9 @@ fn resolving_backtrack() {
         dep_req("foo", "^1"),
     ], &mut reg).unwrap();
 
-    assert_that(&res, contains(names([("root", "1.0.0"),
-                                      ("foo", "1.0.1"),
-                                      ("baz", "1.0.0")])));
+    assert_that(&res, contains(names(&[("root", "1.0.0"),
+                                       ("foo", "1.0.1"),
+                                       ("baz", "1.0.0")])));
 }
 
 #[test]
@@ -283,16 +283,16 @@ fn resolving_allows_multiple_compatible_versions() {
         dep("bar"),
     ], &mut reg).unwrap();
 
-    assert_that(&res, contains(names([("root", "1.0.0"),
-                                      ("foo", "1.0.0"),
-                                      ("foo", "2.0.0"),
-                                      ("foo", "0.1.0"),
-                                      ("foo", "0.2.0"),
-                                      ("d1", "1.0.0"),
-                                      ("d2", "1.0.0"),
-                                      ("d3", "1.0.0"),
-                                      ("d4", "1.0.0"),
-                                      ("bar", "1.0.0")])));
+    assert_that(&res, contains(names(&[("root", "1.0.0"),
+                                       ("foo", "1.0.0"),
+                                       ("foo", "2.0.0"),
+                                       ("foo", "0.1.0"),
+                                       ("foo", "0.2.0"),
+                                       ("d1", "1.0.0"),
+                                       ("d2", "1.0.0"),
+                                       ("d3", "1.0.0"),
+                                       ("d4", "1.0.0"),
+                                       ("bar", "1.0.0")])));
 }
 
 #[test]
@@ -316,10 +316,10 @@ fn resolving_with_deep_backtracking() {
         dep_req("foo", "1"),
     ], &mut reg).unwrap();
 
-    assert_that(&res, contains(names([("root", "1.0.0"),
-                                      ("foo", "1.0.0"),
-                                      ("bar", "2.0.0"),
-                                      ("baz", "1.0.1")])));
+    assert_that(&res, contains(names(&[("root", "1.0.0"),
+                                       ("foo", "1.0.0"),
+                                       ("bar", "2.0.0"),
+                                       ("baz", "1.0.1")])));
 }
 
 #[test]
index 4d9bfacb8c810ce3cc61e4d5615fb1c13fbb1b46..1216617b50d43cc1c31029cf80df218c0176604f 100644 (file)
@@ -45,6 +45,6 @@ impl RepoBuilder {
         let tree = self.repo.find_tree(id).unwrap();
         let sig = self.repo.signature().unwrap();
         self.repo.commit(Some("HEAD"), &sig, &sig,
-                         "Initial commit", &tree, []).unwrap();
+                         "Initial commit", &tree, &[]).unwrap();
     }
 }
index 36532ffdd8577d215bcac5ba58f1ac9b5bdfd2a9..31fb1350e4697d20a05640cd9e6264bce4bbe791 100644 (file)
@@ -4,7 +4,7 @@ use std::io::process::{ProcessOutput};
 use std::io;
 use std::os;
 use std::path::{Path,BytesContainer};
-use std::str;
+use std::str::{mod, Str};
 use std::vec::Vec;
 use url::Url;
 use hamcrest as ham;
@@ -119,6 +119,7 @@ impl ProjectBuilder {
 
     pub fn process<T: ToCStr>(&self, program: T) -> ProcessBuilder {
         process(program)
+            .unwrap()
             .cwd(self.root())
             .env("HOME", Some(paths::home().display().to_string().as_slice()))
     }
@@ -296,7 +297,7 @@ impl Execs {
 
     fn match_std(&self, expected: Option<&String>, actual: &[u8],
                  description: &str, extra: &[u8]) -> ham::MatchResult {
-        match expected.as_ref().map(|s| s.as_slice()) {
+        match expected.map(|s| Str::as_slice(s)) {
             None => ham::success(),
             Some(out) => {
                 let actual = match str::from_utf8(actual) {
@@ -516,4 +517,5 @@ pub static PACKAGING:   &'static str = "   Packaging";
 pub static DOWNLOADING: &'static str = " Downloading";
 pub static UPLOADING:   &'static str = "   Uploading";
 pub static VERIFYING:   &'static str = "   Verifying";
+#[allow(dead_code)]
 pub static WARNING:     &'static str = "     Warning";
index bac46784df7429ad304140b7cc98ecb1bd8b85fc..8306d49896bfd004d3bb23f5b31dc849e7a7b752 100644 (file)
@@ -104,7 +104,7 @@ pub fn publish(file: &str, line: &str) {
     let parent = repo.find_commit(parent).unwrap();
     repo.commit(Some("HEAD"), &sig, &sig,
                 "Another commit", &tree,
-                [&parent]).unwrap();
+                &[&parent]).unwrap();
 }
 
 pub fn pkg(name: &str, vers: &str, deps: &[(&str, &str)], cksum: &str,
index c2794ff803fbdb6818412f771fcf69b36181b703..513c698b2110ab525a9cc057ca78f731626431a1 100644 (file)
@@ -34,8 +34,10 @@ fn new_path() -> Vec<Path> {
 test!(list_commands_looks_at_path {
     let proj = project("list-non-overlapping");
     let proj = fake_executable(proj, &Path::new("path-test"), "cargo-1");
-    let pr = process(cargo_dir().join("cargo")).cwd(proj.root())
-                    .env("HOME", Some(paths::home()));
+    let pr = process(cargo_dir().join("cargo"))
+        .unwrap()
+        .cwd(proj.root())
+        .env("HOME", Some(paths::home()));
 
     let mut path = new_path();
     path.push(proj.root().join("path-test"));
@@ -47,7 +49,7 @@ test!(list_commands_looks_at_path {
 })
 
 test!(find_closest_biuld_to_build {
-    let pr = process(cargo_dir().join("cargo"))
+    let pr = process(cargo_dir().join("cargo")).unwrap()
                     .arg("biuld").cwd(paths::root())
                     .env("HOME", Some(paths::home()));
 
@@ -62,7 +64,7 @@ Did you mean `build`?
 
 // if a subcommand is more than 3 edit distance away, we don't make a suggestion
 test!(find_closest_dont_correct_nonsense {
-    let pr = process(cargo_dir().join("cargo"))
+    let pr = process(cargo_dir().join("cargo")).unwrap()
                     .arg("asdf").cwd(paths::root())
                     .env("HOME", Some(paths::home()));
 
index b3267d6090cc70d7d2b9669619946fb8f1f66c04..18d92de92ceb2d2b8c2653c2ef9006287dd1308c 100644 (file)
@@ -32,7 +32,7 @@ test!(cargo_bench_simple {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-        process(p.bin("foo")),
+        process(p.bin("foo")).unwrap(),
         execs().with_stdout("hello\n"));
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("bench"),
@@ -169,7 +169,7 @@ test!(cargo_bench_failing_test {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-        process(p.bin("foo")),
+        process(p.bin("foo")).unwrap(),
         execs().with_stdout("hello\n"));
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("bench"),
index c6fe04f69f1d94b28bd7f72417f5b13e9bd55fbe..c45035a3d4ed555737f3d8cb2d638928a7ec7282 100644 (file)
@@ -7,7 +7,7 @@ fn setup() {
 test!(cargo_clean_simple {
     let p = project("foo")
               .file("Cargo.toml", basic_bin_manifest("foo").as_slice())
-              .file("src/foo.rs", main_file(r#""i am foo""#, []).as_slice());
+              .file("src/foo.rs", main_file(r#""i am foo""#, &[]).as_slice());
 
     assert_that(p.cargo_process("build"), execs().with_status(0));
     assert_that(&p.build_dir(), existing_dir());
@@ -20,7 +20,7 @@ test!(cargo_clean_simple {
 test!(different_dir {
     let p = project("foo")
               .file("Cargo.toml", basic_bin_manifest("foo").as_slice())
-              .file("src/foo.rs", main_file(r#""i am foo""#, []).as_slice())
+              .file("src/foo.rs", main_file(r#""i am foo""#, &[]).as_slice())
               .file("src/bar/a.rs", "");
 
     assert_that(p.cargo_process("build"), execs().with_status(0));
index 64af6f2c9766a4115511edefc7d8c7d14eeef509..5568c941e7e82d1c9b8261cbb568ff36d129aa12 100644 (file)
@@ -6,7 +6,6 @@ use support::{ResultTest, project, execs, main_file, basic_bin_manifest};
 use support::{COMPILING, RUNNING, cargo_dir, ProjectBuilder};
 use hamcrest::{assert_that, existing_file};
 use support::paths::PathExt;
-use cargo;
 use cargo::util::process;
 
 fn setup() {
@@ -15,20 +14,20 @@ fn setup() {
 test!(cargo_compile_simple {
     let p = project("foo")
         .file("Cargo.toml", basic_bin_manifest("foo").as_slice())
-        .file("src/foo.rs", main_file(r#""i am foo""#, []).as_slice());
+        .file("src/foo.rs", main_file(r#""i am foo""#, &[]).as_slice());
 
     assert_that(p.cargo_process("build"), execs());
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout("i am foo\n"));
 })
 
 test!(cargo_compile_manifest_path {
     let p = project("foo")
         .file("Cargo.toml", basic_bin_manifest("foo").as_slice())
-        .file("src/foo.rs", main_file(r#""i am foo""#, []).as_slice());
+        .file("src/foo.rs", main_file(r#""i am foo""#, &[]).as_slice());
 
     assert_that(p.cargo_process("build")
                  .arg("--manifest-path").arg("foo/Cargo.toml")
@@ -187,7 +186,7 @@ test!(cargo_compile_with_warnings_in_a_dep_package {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -222,7 +221,7 @@ test!(cargo_compile_with_warnings_in_a_dep_package {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout("test passed\n"));
 })
 
@@ -242,7 +241,7 @@ test!(cargo_compile_with_nested_deps_inferred {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -280,7 +279,7 @@ test!(cargo_compile_with_nested_deps_inferred {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout("test passed\n"));
 })
 
@@ -300,7 +299,7 @@ test!(cargo_compile_with_nested_deps_correct_bin {
             name = "foo"
         "#)
         .file("src/main.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -338,7 +337,7 @@ test!(cargo_compile_with_nested_deps_correct_bin {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout("test passed\n"));
 })
 
@@ -359,7 +358,7 @@ test!(cargo_compile_with_nested_deps_shorthand {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -405,7 +404,7 @@ test!(cargo_compile_with_nested_deps_shorthand {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout("test passed\n"));
 })
 
@@ -427,7 +426,7 @@ test!(cargo_compile_with_nested_deps_longhand {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -472,7 +471,7 @@ test!(cargo_compile_with_nested_deps_longhand {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout("test passed\n"));
 })
 
@@ -495,9 +494,9 @@ test!(cargo_compile_with_dep_name_mismatch {
 
             path = "bar"
         "#)
-        .file("src/foo.rs", main_file(r#""i am foo""#, ["bar"]).as_slice())
+        .file("src/foo.rs", main_file(r#""i am foo""#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", basic_bin_manifest("bar").as_slice())
-        .file("bar/src/bar.rs", main_file(r#""i am bar""#, []).as_slice());
+        .file("bar/src/bar.rs", main_file(r#""i am bar""#, &[]).as_slice());
 
     assert_that(p.cargo_process("build"),
                 execs().with_status(101).with_stderr(format!(
@@ -548,7 +547,7 @@ test!(crate_version_env_vars {
     assert_that(p.cargo_process("build"), execs().with_status(0));
 
     assert_that(
-      process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout(format!("0-5-1 @ alpha.1 in {}\n",
                                   p.root().display()).as_slice()));
 
@@ -704,14 +703,14 @@ test!(self_dependency {
 test!(ignore_broken_symlinks {
     let p = project("foo")
         .file("Cargo.toml", basic_bin_manifest("foo").as_slice())
-        .file("src/foo.rs", main_file(r#""i am foo""#, []).as_slice())
+        .file("src/foo.rs", main_file(r#""i am foo""#, &[]).as_slice())
         .symlink("Notafile", "bar");
 
     assert_that(p.cargo_process("build"), execs());
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout("i am foo\n"));
 })
 
@@ -918,9 +917,9 @@ test!(explicit_examples {
         "#);
 
     assert_that(p.cargo_process("test"), execs());
-    assert_that(process(p.bin("examples/hello")),
+    assert_that(process(p.bin("examples/hello")).unwrap(),
                         execs().with_stdout("Hello, World!\n"));
-    assert_that(process(p.bin("examples/goodbye")),
+    assert_that(process(p.bin("examples/goodbye")).unwrap(),
                         execs().with_stdout("Goodbye, World!\n"));
 })
 
@@ -947,9 +946,9 @@ test!(implicit_examples {
         "#);
 
     assert_that(p.cargo_process("test"), execs().with_status(0));
-    assert_that(process(p.bin("examples/hello")),
+    assert_that(process(p.bin("examples/hello")).unwrap(),
                 execs().with_stdout("Hello, World!\n"));
-    assert_that(process(p.bin("examples/goodbye")),
+    assert_that(process(p.bin("examples/goodbye")).unwrap(),
                 execs().with_stdout("Goodbye, World!\n"));
 })
 
@@ -967,7 +966,7 @@ test!(standard_build_no_ndebug {
         "#);
 
     assert_that(p.cargo_process("build"), execs().with_status(0));
-    assert_that(process(p.bin("foo")), execs().with_stdout("slow\n"));
+    assert_that(process(p.bin("foo")).unwrap(), execs().with_stdout("slow\n"));
 })
 
 test!(release_build_ndebug {
@@ -985,7 +984,7 @@ test!(release_build_ndebug {
 
     assert_that(p.cargo_process("build").arg("--release"),
                 execs().with_status(0));
-    assert_that(process(p.bin("release/foo")), execs().with_stdout("fast\n"));
+    assert_that(process(p.bin("release/foo")).unwrap(), execs().with_stdout("fast\n"));
 })
 
 test!(inferred_main_bin {
@@ -1001,7 +1000,7 @@ test!(inferred_main_bin {
         "#);
 
     assert_that(p.cargo_process("build"), execs().with_status(0));
-    assert_that(process(p.bin("foo")), execs().with_status(0));
+    assert_that(process(p.bin("foo")).unwrap(), execs().with_status(0));
 })
 
 test!(deletion_causes_failure {
@@ -1051,7 +1050,7 @@ test!(bad_cargo_toml_in_target_dir {
         .file("target/Cargo.toml", "bad-toml");
 
     assert_that(p.cargo_process("build"), execs().with_status(0));
-    assert_that(process(p.bin("foo")), execs().with_status(0));
+    assert_that(process(p.bin("foo")).unwrap(), execs().with_status(0));
 })
 
 test!(lib_with_standard_name {
@@ -1370,7 +1369,7 @@ test!(cargo_platform_specific_dependency {
             path = "bar"
         "#)
         .file("src/main.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -1391,7 +1390,7 @@ test!(cargo_platform_specific_dependency {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs().with_stdout("test passed\n"));
 })
 
@@ -1411,7 +1410,7 @@ test!(cargo_platform_specific_dependency {
             path = "bar"
         "#)
         .file("src/main.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -1464,7 +1463,7 @@ test!(cargo_platform_specific_dependency_wrong_platform {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      process(p.bin("foo")).unwrap(),
       execs());
 
     let lockfile = p.root().join("Cargo.lock");
index 735bbb84bc879c179167d13f4743abc9c1de6f42..93771ce63072c8c5f310c2e8f1846eb8a010bcad 100644 (file)
@@ -83,7 +83,7 @@ test!(custom_build_env_vars {
 
                 let out = os::getenv("CARGO_MANIFEST_DIR").unwrap();
                 let p1 = Path::new(out);
-                let p2 = os::make_absolute(&Path::new(file!()).dir_path().dir_path());
+                let p2 = os::make_absolute(&Path::new(file!()).dir_path().dir_path()).unwrap();
                 assert!(p1 == p2, "{{}} != {{}}", p1.display(), p2.display());
 
                 let opt = os::getenv("OPT_LEVEL").unwrap();
index 8d8f45dededcbe775bcbe4a3f38d1f81c81f4154..5972630e0b3e7d0d835ed77afeb3f9e8a93bbdc0 100644 (file)
@@ -112,7 +112,7 @@ test!(cargo_compile_simple_git_dep {
 
             name = "foo"
         "#, git_project.url()))
-        .file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, ["dep1"]));
+        .file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, &["dep1"]));
 
     let root = project.root();
     let git_root = git_project.root();
@@ -130,7 +130,7 @@ test!(cargo_compile_simple_git_dep {
     assert_that(&project.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(project.bin("foo")),
+      cargo::util::process(project.bin("foo")).unwrap(),
       execs().with_stdout("hello world\n"));
 })
 
@@ -179,7 +179,7 @@ test!(cargo_compile_git_dep_branch {
 
             name = "foo"
         "#, git_project.url()))
-        .file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, ["dep1"]));
+        .file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, &["dep1"]));
 
     let root = project.root();
     let git_root = git_project.root();
@@ -197,7 +197,7 @@ test!(cargo_compile_git_dep_branch {
     assert_that(&project.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(project.bin("foo")),
+      cargo::util::process(project.bin("foo")).unwrap(),
       execs().with_stdout("hello world\n"));
 })
 
@@ -249,7 +249,7 @@ test!(cargo_compile_git_dep_tag {
 
             name = "foo"
         "#, git_project.url()))
-        .file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, ["dep1"]));
+        .file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, &["dep1"]));
 
     let root = project.root();
     let git_root = git_project.root();
@@ -267,7 +267,7 @@ test!(cargo_compile_git_dep_tag {
     assert_that(&project.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(project.bin("foo")),
+      cargo::util::process(project.bin("foo")).unwrap(),
       execs().with_stdout("hello world\n"));
 })
 
@@ -333,7 +333,7 @@ test!(cargo_compile_with_nested_paths {
             name = "parent"
         "#, git_project.url()))
         .file("src/parent.rs",
-              main_file(r#""{}", dep1::hello()"#, ["dep1"]).as_slice());
+              main_file(r#""{}", dep1::hello()"#, &["dep1"]).as_slice());
 
     p.cargo_process("build")
         .exec_with_output()
@@ -342,7 +342,7 @@ test!(cargo_compile_with_nested_paths {
     assert_that(&p.bin("parent"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("parent")),
+      cargo::util::process(p.bin("parent")).unwrap(),
       execs().with_stdout("hello world\n"));
 })
 
@@ -406,7 +406,7 @@ test!(cargo_compile_with_meta_package {
             name = "parent"
         "#, git_project.url(), git_project.url()))
         .file("src/parent.rs",
-              main_file(r#""{} {}", dep1::hello(), dep2::hello()"#, ["dep1", "dep2"]).as_slice());
+              main_file(r#""{} {}", dep1::hello(), dep2::hello()"#, &["dep1", "dep2"]).as_slice());
 
     p.cargo_process("build")
         .exec_with_output()
@@ -415,7 +415,7 @@ test!(cargo_compile_with_meta_package {
     assert_that(&p.bin("parent"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("parent")),
+      cargo::util::process(p.bin("parent")).unwrap(),
       execs().with_stdout("this is dep1 this is dep2\n"));
 })
 
@@ -438,13 +438,13 @@ test!(cargo_compile_with_short_ssh_git {
 
             name = "foo"
         "#, url))
-        .file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, ["dep1"]));
+        .file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, &["dep1"]));
 
     assert_that(project.cargo_process("build"),
         execs()
         .with_stdout("")
         .with_stderr(format!("Cargo.toml is not a valid manifest\n\n\
-                              invalid url `{}`: Relative URL without a base\n", url)));
+                              invalid url `{}`: relative URL without a base\n", url)));
 })
 
 test!(two_revs_same_deps {
@@ -552,7 +552,7 @@ test!(recompilation {
             name = "foo"
         "#, git_project.url()))
         .file("src/foo.rs",
-              main_file(r#""{}", bar::bar()"#, ["bar"]).as_slice());
+              main_file(r#""{}", bar::bar()"#, &["bar"]).as_slice());
 
     // First time around we should compile both foo and bar
     assert_that(p.cargo_process("build"),
@@ -1230,7 +1230,7 @@ test!(git_dep_build_cmd {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -1254,7 +1254,7 @@ test!(git_dep_build_cmd {
         execs().with_status(0));
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      cargo::util::process(p.bin("foo")).unwrap(),
       execs().with_stdout("0\n"));
 
     // Touching bar.rs.in should cause the `build` command to run again.
@@ -1266,7 +1266,7 @@ test!(git_dep_build_cmd {
         execs().with_status(0));
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      cargo::util::process(p.bin("foo")).unwrap(),
       execs().with_stdout("1\n"));
 })
 
index 2e348db69e44b9838f1d73c72eb7895f7a116a28..f58fc27db598853786662303fdd6a9784b22d21c 100644 (file)
@@ -280,7 +280,7 @@ test!(old_custom_build_env_vars {
 
                 let out = os::getenv("CARGO_MANIFEST_DIR").unwrap();
                 let p1 = Path::new(out);
-                let p2 = os::make_absolute(&Path::new(file!()).dir_path().dir_path());
+                let p2 = os::make_absolute(&Path::new(file!()).dir_path().dir_path()).unwrap();
                 assert!(p1 == p2, "{{}} != {{}}", p1.display(), p2.display());
             }}
         "#,
index 58c30f820b99bd963b3dabd18e584b0c447d147f..40175eb2f58ce039a0087fc5362ee506b139fd1d 100644 (file)
@@ -29,7 +29,7 @@ test!(cargo_compile_with_nested_deps_shorthand {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -81,7 +81,7 @@ test!(cargo_compile_with_nested_deps_shorthand {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      cargo::util::process(p.bin("foo")).unwrap(),
       execs().with_stdout("test passed\n"));
 
     println!("cleaning");
@@ -119,7 +119,7 @@ test!(cargo_compile_with_root_dev_deps {
             name = "foo"
         "#)
         .file("src/main.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice());
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice());
     let p2 = project("bar")
         .file("Cargo.toml", r#"
             [package]
@@ -157,7 +157,7 @@ test!(cargo_compile_with_root_dev_deps_with_testing {
             name = "foo"
         "#)
         .file("src/main.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice());
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice());
     let p2 = project("bar")
         .file("Cargo.toml", r#"
             [package]
@@ -205,7 +205,7 @@ test!(cargo_compile_with_transitive_dev_deps {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -236,7 +236,7 @@ test!(cargo_compile_with_transitive_dev_deps {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      cargo::util::process(p.bin("foo")).unwrap(),
       execs().with_stdout("zoidberg\n"));
 })
 
@@ -457,7 +457,7 @@ test!(nested_deps_recompile {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("src/bar/Cargo.toml", r#"
             [project]
 
@@ -648,7 +648,7 @@ test!(path_dep_build_cmd {
             name = "foo"
         "#)
         .file("src/foo.rs",
-              main_file(r#""{}", bar::gimme()"#, ["bar"]).as_slice())
+              main_file(r#""{}", bar::gimme()"#, &["bar"]).as_slice())
         .file("bar/Cargo.toml", r#"
             [project]
 
@@ -677,7 +677,7 @@ test!(path_dep_build_cmd {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      cargo::util::process(p.bin("foo")).unwrap(),
       execs().with_stdout("0\n"));
 
     // Touching bar.rs.in should cause the `build` command to run again.
@@ -693,7 +693,7 @@ test!(path_dep_build_cmd {
                                     COMPILING, p.url())));
 
     assert_that(
-      cargo::util::process(p.bin("foo")),
+      cargo::util::process(p.bin("foo")).unwrap(),
       execs().with_stdout("1\n"));
 })
 
index c8c79a11284354ceaef14c36ac8d5b55a619fc16..db5034125a412ef15c395ecc8f59dce5bb6b2eda 100644 (file)
@@ -69,7 +69,7 @@ test!(simple_cross {
     assert_that(&p.target_bin(target, "foo"), existing_file());
 
     assert_that(
-      process(p.target_bin(target, "foo")),
+      process(p.target_bin(target, "foo")).unwrap(),
       execs().with_status(0));
 })
 
@@ -106,7 +106,7 @@ test!(simple_deps {
     assert_that(&p.target_bin(target, "foo"), existing_file());
 
     assert_that(
-      process(p.target_bin(target, "foo")),
+      process(p.target_bin(target, "foo")).unwrap(),
       execs().with_status(0));
 })
 
@@ -184,7 +184,7 @@ test!(plugin_deps {
     assert_that(&foo.target_bin(target, "foo"), existing_file());
 
     assert_that(
-      process(foo.target_bin(target, "foo")),
+      process(foo.target_bin(target, "foo")).unwrap(),
       execs().with_status(0));
 })
 
@@ -269,7 +269,7 @@ test!(plugin_to_the_max {
     assert_that(&foo.target_bin(target, "foo"), existing_file());
 
     assert_that(
-      process(foo.target_bin(target, "foo")),
+      process(foo.target_bin(target, "foo")).unwrap(),
       execs().with_status(0));
 })
 
index 79694d56e50ecad304981290516fa8c2c538d774..d480caab057705b62987f4f97331b12cc3852169 100644 (file)
@@ -11,13 +11,13 @@ fn setup() {
 }
 
 fn my_process(s: &str) -> ProcessBuilder {
-    process(s)
+    process(s).unwrap()
         .cwd(paths::root())
         .env("HOME", Some(paths::home()))
 }
 
 fn cargo_process(s: &str) -> ProcessBuilder {
-    process(cargo_dir().join("cargo")).arg(s)
+    process(cargo_dir().join("cargo")).unwrap().arg(s)
         .cwd(paths::root())
         .env("HOME", Some(paths::home()))
 }
@@ -136,9 +136,9 @@ test!(finds_author_username {
 })
 
 test!(finds_author_git {
-    my_process("git").args(["config", "--global", "user.name", "bar"])
+    my_process("git").args(&["config", "--global", "user.name", "bar"])
                      .exec().assert();
-    my_process("git").args(["config", "--global", "user.email", "baz"])
+    my_process("git").args(&["config", "--global", "user.email", "baz"])
                      .exec().assert();
     assert_that(cargo_process("new").arg("foo").env("USER", Some("foo")),
                 execs().with_status(0));
@@ -149,9 +149,9 @@ test!(finds_author_git {
 })
 
 test!(author_prefers_cargo {
-    my_process("git").args(["config", "--global", "user.name", "bar"])
+    my_process("git").args(&["config", "--global", "user.name", "bar"])
                      .exec().assert();
-    my_process("git").args(["config", "--global", "user.email", "baz"])
+    my_process("git").args(&["config", "--global", "user.email", "baz"])
                      .exec().assert();
     let root = paths::root();
     fs::mkdir(&root.join(".cargo"), USER_RWX).assert();
index c475b71f1734894499717747478d1a8806eb1790..56a852b21be2040f30407a4ea21c50d82005621c 100644 (file)
@@ -4,7 +4,7 @@ use tar::Archive;
 use flate2::reader::GzDecoder;
 
 use support::{project, execs, cargo_dir, ResultTest};
-use support::{PACKAGING, WARNING, VERIFYING, COMPILING};
+use support::{PACKAGING, VERIFYING, COMPILING};
 use hamcrest::{assert_that, existing_file};
 
 fn setup() {
index 3eb5f982ebb68534fcd74e82bfbbcff53f69f871..585bfc444c2862a82408fbd0c229072a7196c554 100644 (file)
@@ -24,7 +24,7 @@ test!(simple {
         "#)
         .file("src/main.rs", "fn main() {}");
 
-    r::mock_pkg("bar", "0.0.1", []);
+    r::mock_pkg("bar", "0.0.1", &[]);
 
     assert_that(p.cargo_process("build"),
                 execs().with_status(0).with_stdout(format!("\
@@ -64,8 +64,8 @@ test!(deps {
         "#)
         .file("src/main.rs", "fn main() {}");
 
-    r::mock_pkg("baz", "0.0.1", []);
-    r::mock_pkg("bar", "0.0.1", [("baz", "*")]);
+    r::mock_pkg("baz", "0.0.1", &[]);
+    r::mock_pkg("bar", "0.0.1", &[("baz", "*")]);
 
     assert_that(p.cargo_process("build"),
                 execs().with_status(0).with_stdout(format!("\
@@ -117,7 +117,7 @@ test!(bad_cksum {
         "#)
         .file("src/main.rs", "fn main() {}");
 
-    r::mock_pkg("bad-cksum", "0.0.1", []);
+    r::mock_pkg("bad-cksum", "0.0.1", &[]);
     File::create(&r::mock_archive_dst("bad-cksum", "0.0.1")).unwrap();
 
     assert_that(p.cargo_process("build").arg("-v"),
@@ -152,7 +152,7 @@ location searched: registry file://[..]
 version required: >= 0.0.0
 "));
 
-    r::mock_pkg("notyet", "0.0.1", []);
+    r::mock_pkg("notyet", "0.0.1", &[]);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0).with_stdout(format!("\
@@ -202,7 +202,7 @@ location searched: registry file://[..]
 version required: ^0.0.1
 "));
 
-    r::mock_pkg("notyet", "0.0.1", []);
+    r::mock_pkg("notyet", "0.0.1", &[]);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("package"),
                 execs().with_status(0).with_stdout(format!("\
@@ -236,7 +236,7 @@ test!(lockfile_locks {
         .file("src/main.rs", "fn main() {}");
     p.build();
 
-    r::mock_pkg("bar", "0.0.1", []);
+    r::mock_pkg("bar", "0.0.1", &[]);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0).with_stdout(format!("\
@@ -248,7 +248,7 @@ test!(lockfile_locks {
    dir = p.url()).as_slice()));
 
     p.root().move_into_the_past().unwrap();
-    r::mock_pkg("bar", "0.0.2", []);
+    r::mock_pkg("bar", "0.0.2", &[]);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0).with_stdout(""));
@@ -268,8 +268,8 @@ test!(lockfile_locks_transitively {
         .file("src/main.rs", "fn main() {}");
     p.build();
 
-    r::mock_pkg("baz", "0.0.1", []);
-    r::mock_pkg("bar", "0.0.1", [("baz", "*")]);
+    r::mock_pkg("baz", "0.0.1", &[]);
+    r::mock_pkg("bar", "0.0.1", &[("baz", "*")]);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0).with_stdout(format!("\
@@ -283,8 +283,8 @@ test!(lockfile_locks_transitively {
    dir = p.url()).as_slice()));
 
     p.root().move_into_the_past().unwrap();
-    r::mock_pkg("baz", "0.0.2", []);
-    r::mock_pkg("bar", "0.0.2", [("baz", "*")]);
+    r::mock_pkg("baz", "0.0.2", &[]);
+    r::mock_pkg("bar", "0.0.2", &[("baz", "*")]);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0).with_stdout(""));
@@ -304,10 +304,10 @@ test!(yanks_are_not_used {
         .file("src/main.rs", "fn main() {}");
     p.build();
 
-    r::mock_pkg("baz", "0.0.1", []);
-    r::mock_pkg_yank("baz", "0.0.2", [], true);
-    r::mock_pkg("bar", "0.0.1", [("baz", "*")]);
-    r::mock_pkg_yank("bar", "0.0.2", [("baz", "*")], true);
+    r::mock_pkg("baz", "0.0.1", &[]);
+    r::mock_pkg_yank("baz", "0.0.2", &[], true);
+    r::mock_pkg("bar", "0.0.1", &[("baz", "*")]);
+    r::mock_pkg_yank("bar", "0.0.2", &[("baz", "*")], true);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0).with_stdout(format!("\
@@ -335,9 +335,9 @@ test!(relying_on_a_yank_is_bad {
         .file("src/main.rs", "fn main() {}");
     p.build();
 
-    r::mock_pkg("baz", "0.0.1", []);
-    r::mock_pkg_yank("baz", "0.0.2", [], true);
-    r::mock_pkg("bar", "0.0.1", [("baz", "=0.0.2")]);
+    r::mock_pkg("baz", "0.0.1", &[]);
+    r::mock_pkg_yank("baz", "0.0.2", &[], true);
+    r::mock_pkg("bar", "0.0.1", &[("baz", "=0.0.2")]);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(101).with_stderr("\
@@ -361,14 +361,14 @@ test!(yanks_in_lockfiles_are_ok {
         .file("src/main.rs", "fn main() {}");
     p.build();
 
-    r::mock_pkg("bar", "0.0.1", []);
+    r::mock_pkg("bar", "0.0.1", &[]);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0));
 
     fs::rmdir_recursive(&r::registry_path().join("3")).unwrap();
 
-    r::mock_pkg_yank("bar", "0.0.1", [], true);
+    r::mock_pkg_yank("bar", "0.0.1", &[], true);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0).with_stdout(""));
@@ -395,7 +395,7 @@ test!(update_with_lockfile_if_packages_missing {
         .file("src/main.rs", "fn main() {}");
     p.build();
 
-    r::mock_pkg("bar", "0.0.1", []);
+    r::mock_pkg("bar", "0.0.1", &[]);
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0));
     p.root().move_into_the_past().unwrap();
@@ -422,11 +422,11 @@ test!(update_lockfile {
         .file("src/main.rs", "fn main() {}");
     p.build();
 
-    r::mock_pkg("bar", "0.0.1", []);
+    r::mock_pkg("bar", "0.0.1", &[]);
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0));
 
-    r::mock_pkg("bar", "0.0.2", []);
+    r::mock_pkg("bar", "0.0.2", &[]);
     fs::rmdir_recursive(&paths::home().join(".cargo/registry")).unwrap();
     assert_that(p.process(cargo_dir().join("cargo")).arg("update")
                  .arg("-p").arg("bar"),
index b1469ba35d38debeec8b8e24d66b83bf576caeab..4b39e4dabc16561ce6ec1d77c15a08579aa82882 100644 (file)
@@ -30,7 +30,7 @@ test!(cargo_test_simple {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-        process(p.bin("foo")),
+        process(p.bin("foo")).unwrap(),
         execs().with_stdout("hello\n"));
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("test"),
@@ -121,7 +121,7 @@ test!(cargo_test_failing_test {
     assert_that(&p.bin("foo"), existing_file());
 
     assert_that(
-        process(p.bin("foo")),
+        process(p.bin("foo")).unwrap(),
         execs().with_stdout("hello\n"));
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("test"),